package com.work.reports;

import java.util.Map;

import com.work.reports.types.*;

public class ReportsFacade {

	private static ReportsFacade instance;
	
	private ReportsFacade() {
		
	}
	
	public static ReportsFacade instance() {
		if (instance == null) {
			instance = new ReportsFacade();
		}
		
		return instance;
	}
	
	public PdfReport getReportGenerator(ReportType type, Map<String, Object> criteria) {
		PdfReport reportGenerator = null;
		
		if (type == ReportType.TAKEN_OVERTIME) {
			reportGenerator = new TakenOvertimeReportGenerator(type, criteria);
		} else if (type == ReportType.TOTAL_WORKED_OVERTIME) {
			reportGenerator = new TakenOvertimeReportGenerator(type, criteria);
		} else if (type == ReportType.TAKEN_LEAVE) {
			reportGenerator = new TakenLeaveReportGenerator(type, criteria);
		}
		
		return reportGenerator;
	}
}
